#Title: Examples : JavaScript Date Object

Date
Returns today's date including date, month, and year. Note that the getMonth method returns 0 in January, 1 in February etc. So add 1 to the getMonth method to display the correct date.

Time
Returns the current local time including hour, minutes, and seconds. To return the GMT time use getUTCHours, getUTCMinutes etc.

Set date
You can also set the date or time into the date object, with the setDate, setHour etc. Note that in this example, only the FullYear is set.

UTC time
The getUTCDate method returns the Universal Coordinated Time which is the time set by the World Time Standard.

Display weekday
A simple script that allows you to write the name of the current day instead of the number. Note that the array object is used to store the names, and that Sunday=0, Monday=1 etc.

Display full date
How to write a complete date with the name of the day and the name of the month.

Display time
How to display the time on your pages. Note that this script is similar to the Time example above, only this script writes the time in an input field. And it continues writing the time one time per second

#Title: JavaScript Date Object
#Element: 176: JavaScript Date Object